package utn.frsf.cidisi.upcolbpip.b2bcollaboration.diagram.part;

import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

import org.eclipse.gmf.runtime.notation.View;

import utn.frsf.cidisi.upcolbpip.b2bcollaboration.diagram.edit.parts.B2BCollaborationEditPart;
import utn.frsf.cidisi.upcolbpip.b2bcollaboration.diagram.edit.parts.PartnerRoleEditPart;
import utn.frsf.cidisi.upcolbpip.b2bcollaborations.B2BCollaboration;
import utn.frsf.cidisi.upcolbpip.b2bcollaborations.PartnerRole;

/**
 * @generated
 */
public class UpcolbpipDiagramUpdater {

	/**
	 * @generated
	 */
	public static List getSemanticChildren(View view) {
		switch (UpcolbpipVisualIDRegistry.getVisualID(view)) {
		case B2BCollaborationEditPart.VISUAL_ID:
			return getB2BCollaboration_79SemanticChildren(view);
		}
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getB2BCollaboration_79SemanticChildren(View view) {
		if (!view.isSetElement()) {
			return Collections.EMPTY_LIST;
		}
		B2BCollaboration modelElement = (B2BCollaboration) view.getElement();
		List result = new LinkedList();
		for (Iterator it = modelElement.getParticipatingRoles().iterator(); it
				.hasNext();) {
			PartnerRole childElement = (PartnerRole) it.next();
			int visualID = UpcolbpipVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == PartnerRoleEditPart.VISUAL_ID) {
				result.add(new UpcolbpipNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List getContainedLinks(View view) {
		switch (UpcolbpipVisualIDRegistry.getVisualID(view)) {
		case B2BCollaborationEditPart.VISUAL_ID:
			return getB2BCollaboration_79ContainedLinks(view);
		case PartnerRoleEditPart.VISUAL_ID:
			return getPartnerRole_1001ContainedLinks(view);
		}
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getIncomingLinks(View view) {
		switch (UpcolbpipVisualIDRegistry.getVisualID(view)) {
		case PartnerRoleEditPart.VISUAL_ID:
			return getPartnerRole_1001IncomingLinks(view);
		}
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getOutgoingLinks(View view) {
		switch (UpcolbpipVisualIDRegistry.getVisualID(view)) {
		case PartnerRoleEditPart.VISUAL_ID:
			return getPartnerRole_1001OutgoingLinks(view);
		}
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getB2BCollaboration_79ContainedLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getPartnerRole_1001ContainedLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getPartnerRole_1001IncomingLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getPartnerRole_1001OutgoingLinks(View view) {
		return Collections.EMPTY_LIST;
	}

}
